package com.app.ui.activity;

import android.os.Bundle;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.app.ui.activity.action.BaseBarActivity;
import com.wxj.zx.R;

import butterknife.Bind;
import butterknife.ButterKnife;


public class WebViewActivity extends BaseBarActivity {


    @Bind(R.id.web_view)
    WebView webView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_webview);
        ButterKnife.bind(this);

        String url = getStringExtra("arg1");
        WebSettings settings = webView.getSettings();
        settings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
        settings.setBlockNetworkImage(false);
        settings.setJavaScriptEnabled(true);
        settings.setBlockNetworkImage(false);
        webView.loadUrl(url);
    }

    @Override
    public void onBackPressed() {
        if (webView.canGoBack()) {
            webView.goBack();
            return;
        }
        super.onBackPressed();
    }


}
